package top.lshaci.learning.jvm.string;

/**
 * StringTest
 *
 * @author lshaci
 * @date 2020/7/15 14:15
 * @since 1.0.0
 */
public class StringExchange {

    String s = new String("good");
    char[] arr = {'t', 'e', 's', 't'};

    public void change(String str, char[] ch) {
        str = "hello";
        ch[0] = 'b';
    }

    public static void main(String[] args) {
        StringExchange exchange = new StringExchange();
        exchange.change(exchange.s, exchange.arr);

        System.err.println(exchange.s); // good
        System.err.println(exchange.arr); // best
     }

}
